95709ac01ea87493c30b3d8d3d5c351675cad821,jsurfer-benchmark/src/main/java/org/jsfr/json/BenchmarkCollectSingleValue.java,BenchmarkCollectSingleValue,benchmarJacksonCollectSingleValue,#,111
Before Change
@Benchmark
public Object benchmarJacksonCollectSingleValue() throws IOException {
JsonNode jsonNode = om.readTree(json);
String value = jsonNode.get("store").get("book").elements().next().get("author").asText();
LOGGER.trace("The author of the first book: {}", value);
return value;
}
After Change
@Benchmark
public Object benchmarkJacksonCollectSingleValue() throws IOException {
JsonNode jsonNode = om.readTree(json);
Iterator<JsonNode> books = jsonNode.get("store").get("book").elements();
books.next();
books.next();
books.next();
String value = books.next().get("author").asText();
LOGGER.trace("The author of the first book: {}", value);